package com.api.test.controller;

import com.api.test.Util.R;
import com.api.test.bean.Fire.FireCotrolWater;
import com.api.test.bean.Meter.TreeMeter;
import com.api.test.bean.smr3001.Fire;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class MeterApi {
    @RequestMapping(value="/tpson/open/device/log/smr1210",method = RequestMethod.POST)
        public R smr1210(@RequestBody TreeMeter treeMeter)
    {
        System.out.println("进入"+System.currentTimeMillis());
        System.out.println("treeMeter"+treeMeter.getDeviceCode());
        if(treeMeter!=null)
        {
            return R.ok();
        }
        return R.error(500,"未取数据");

    }

            @RequestMapping(value="/tpson/open/device/log/smr1210/v22",method = RequestMethod.POST)
        public R smr1210(@RequestBody FireCotrolWater fireCotrolWater)
        {
            System.out.println("进入"+System.currentTimeMillis());
            System.out.println("fireCotrolWater"+fireCotrolWater.toString());
            if(fireCotrolWater!=null)
            {return R.ok();}
            return R.error(400,"未取数据");

        }

    @RequestMapping(value="/tpson/open/device/log/smr3001",method = RequestMethod.POST)
    public R smr3001Api(@RequestBody Fire fire)
    {
        System.out.println("进入"+System.currentTimeMillis());
        System.out.println("smr3001Api"+fire.toString());
        if(fire!=null)
        {return R.ok();}
        return R.error(500,"未取数据");
    }
}
